/*
 * @Author: wuhao930406 1148547900@qq.com
 * @Date: 2023-05-26 11:32:31
 * @LastEditors: wuhao930406 1148547900@qq.com
 * @LastEditTime: 2023-09-19 09:16:37
 * @FilePath: /utools_web/src/components/DragModal/index.jsx
 * @Description:ty
 *
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
 */
import { Modal } from 'antd';
import { useRef, useState } from 'react';

const DragModal = (props) => {
  const [disabled, setDisabled] = useState(false);
  const [bounds, setBounds] = useState({
    left: 0,
    top: 0,
    bottom: 0,
    right: 0,
  });
  const draggleRef = useRef(null);
  const onStart = (_event, uiData) => {
    const { clientWidth, clientHeight } = window.document.documentElement;
    const targetRect = draggleRef?.current?.getBoundingClientRect();
    if (!targetRect) {
      return;
    }
    setBounds({
      left: -targetRect.left + uiData.x,
      right: clientWidth - (targetRect.right - uiData.x),
      top: -targetRect.top + uiData.y,
      bottom: clientHeight - (targetRect.bottom - uiData.y),
    });
  };

  return (
    <Modal style={{ top: '4%' }} footer={false} destroyOnClose maskClosable={false} {...props}>
      {props?.children}
    </Modal>
  );
};


export {
  Add,
  AddNotice,
  AddPro,
  AddReply,
  EditPro,
  Header,
  Infos,
  ItemAE,
  Join,
  Pwd,
  EditNotice
} from './formdoms'

export default DragModal;
